<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
  <caption>个人信息</caption>
  <tr>
    <td>照片</td>
    <td id="head_td"></td>
  </tr>
  <tr>
    <td>名字：</td>
    <td id="name_td"></td>
  </tr>
  <tr>
    <td>年龄：</td>
    <td id="age_td"></td>
  </tr>
  <tr>
    <td>好友：</td>
    <td id="friend_td"></td>
  </tr>
</table>
<input type="button" value="请求数据" onclick="f()">
<script>
  function f() {
    let person={
      name:"焰灵姬",
      age:19,
      url:"../004.jpeg",
      friends:["韩非","血衣侯","海姣"]
    }
    let head_td  = document.querySelector("#head_td")
    let name_td = document.querySelector("#name_td")
    let age_td  = document.querySelector("#age_td")
    let friend_td = document.querySelector("#friend_td")

    let img = document.createElement("img")
    img.src = person.url
    img.width=200
    head_td.append(img)
    name_td.innerText = person.name
    age_td.innerText =person.age
    f = person.friends
    for (let arr of f ) {
      let ul = document.createElement("ul")
      let li = document.createElement("li")
      li.append(arr)
      ul.append(li)
      friend_td.append(ul)
    }



  }
</script>
</body>
</html>